package com.enjoy.cap6.config;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

public class LccImportSelector implements ImportSelector {
//ImportSelector:是一个接口,返回需要导入到容器的组件的全类名数组
	@Override
	public String[] selectImports(AnnotationMetadata importingClassMetadata) {
		//返回全类名的bean
		//return null;  返回为空 找不到类报空指针异常
		System.out.println("自定义ImportSelector,按字符串类路径向容器添加组件");
		return new String[]{"com.enjoy.cap6.bean.Fish","com.enjoy.cap6.bean.Tiger"};
	}

}
